# Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an &quot;AS IS&quot; BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.


# NOTE: This class is auto generated by the swagger code generator program.
# https://github.com/swagger-api/swagger-codegen.git
# Do not edit the class manually.

defmodule GoogleApi.QPXExpress.V1.Model.SliceInput do
  @moduledoc """
  Criteria a desired slice must satisfy.

  ## Attributes

  - alliance (String): Slices with only the carriers in this alliance should be returned; do not use this field with permittedCarrier. Allowed values are ONEWORLD, SKYTEAM, and STAR. Defaults to: `null`.
  - date (String): Departure date in YYYY-MM-DD format. Defaults to: `null`.
  - destination (String): Airport or city IATA designator of the destination. Defaults to: `null`.
  - kind (String): Identifies this as a slice input object, representing the criteria a desired slice must satisfy. Value: the fixed string qpxexpress#sliceInput. Defaults to: `null`.
  - maxConnectionDuration (Integer): The longest connection between two legs, in minutes, you are willing to accept. Defaults to: `null`.
  - maxStops (Integer): The maximum number of stops you are willing to accept in this slice. Defaults to: `null`.
  - origin (String): Airport or city IATA designator of the origin. Defaults to: `null`.
  - permittedCarrier (List[String]): A list of 2-letter IATA airline designators. Slices with only these carriers should be returned. Defaults to: `null`.
  - permittedDepartureTime (TimeOfDayRange): Slices must depart in this time of day range, local to the point of departure. Defaults to: `null`.
  - preferredCabin (String): Prefer solutions that book in this cabin for this slice. Allowed values are COACH, PREMIUM_COACH, BUSINESS, and FIRST. Defaults to: `null`.
  - prohibitedCarrier (List[String]): A list of 2-letter IATA airline designators. Exclude slices that use these carriers. Defaults to: `null`.
  """

  defstruct [
    :"alliance",
    :"date",
    :"destination",
    :"kind",
    :"maxConnectionDuration",
    :"maxStops",
    :"origin",
    :"permittedCarrier",
    :"permittedDepartureTime",
    :"preferredCabin",
    :"prohibitedCarrier"
  ]
end

defimpl Poison.Decoder, for: GoogleApi.QPXExpress.V1.Model.SliceInput do
  import GoogleApi.QPXExpress.V1.Deserializer
  def decode(value, options) do
    value
    |> deserialize(:"permittedDepartureTime", :struct, GoogleApi.QPXExpress.V1.Model.TimeOfDayRange, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.QPXExpress.V1.Model.SliceInput do
  def encode(value, options) do
    GoogleApi.QPXExpress.V1.Deserializer.serialize_non_nil(value, options)
  end
end

